import request from '@/utils/request';

export function fetchAllReg(token) {
    return request({
        url: '/reg/list',
        method: 'get',
        params: {
            token: token
        }
    });
}

export function addRegistration(token, reg) {
    return request({
        url: '/reg/add',
        method: 'post',
        data: reg,
        params: {
            token: token
        }
    });
}

export function renewReg(token, reg) {
    return request({
        url: '/reg/renew',
        method: 'post',
        data: reg,
        params: {
            token: token
        }
    });
}

export function renewRegBYOpId(token, reg) {
    return request({
        url: '/reg/renewBYOpId',
        method: 'post',
        data: reg,
        params: {
            token: token
        }
    });
}

export function removeReg(regId) {
    return request({
        url: '/reg/remove',
        method: 'post',
        params: {
            regId: regId
        }
    });
}
